package com.cn.wanandroidmvmm.http

import android.util.Log
import java.io.Serializable

data class HttpResult<T>(
    val errorMsg: String? = "",
    val errorCode: Int? = 0,
    val data: T?
) : Serializable {

    fun isSuccess() = errorCode == 0

    fun isNeedReLogin() = errorCode == -1001

    fun printMsg() {
        Log.e("HttpResult", "$errorMsg ?: 无消息")
    }
}

